home *** CD-ROM | disk | FTP | other *** search
/ BMUG PD-ROM 1995 Fall / PD-ROM F95.toast / Telecom / Internet / Internet A-M / HTML+ 1.0b1 ƒ / clip2gif 0.4 for HTML+ / clip2gif v.0.4 for HTML+ README next >
Encoding:
Text File  |  1995-03-10  |  5.9 KB  |  153 lines  |  [ttro/ttxt]

  1. clip2gif v.0.4 
  2. for HTML+
  3.  
  4.  
  5. clip2gif is a utility program for converting PICTs to GIF or JPEG files. The PICT is taken from the clipboard or a file, and the output is written to a file. Options include output size, pixel depth, interlacing, transparency, gray shades only and JPEG compression quality.
  6.  
  7. clip2gif has been written to allow the dynamic creation of pictures to be served on the Web; it's one of the few graphic utilities that (a) are scriptable and (b) write gifs.
  8.  
  9. Usage
  10.  
  11. a) Manual conversion of a PICT file
  12. Launch clip2gif, set the output file format and other options, and use “Convert Pict File...”
  13.  
  14. b) Batch conversion of PICT files
  15. Be sure that the output file format and other options are correct (either by launching clip2gif and setting them, or by having “Save[d] Options” in a previous session), and drag all the PICT files onto the clip2gif icon.
  16.  
  17. c) Manual conversion of the clipboard
  18. Copy a PICT graphic in any application, launch clip2gif, set the output file format and other options, and use “Save Clipboard As...”. Icons can easily be converted too.
  19.  
  20. d) Scripting
  21. clip2gif implements the following AppleEvents:
  22.  
  23. run:
  24.     run
  25.  
  26. convert:
  27.     convert  anything  -- the file(s) to convert, or {width,height} (default: clipboard)
  28.         saving as  type class
  29.          [in  file specification]
  30.          [transparency  boolean]
  31.          [interlacing  boolean]
  32.          [gray shades  boolean]
  33.          [depth  small integer]  -- bits per pixels
  34.      [scale  small integer]  -- scale factor in %
  35.      [quality  very low/low/normal/high/very high]
  36.          [drawing  list]
  37.  
  38. quit:
  39.     quit
  40.  
  41. Note that “convert” corresponds to the 'odoc' AppleEvent. Note also that due to a limitation of the Mac toolbox, clip2gif must be active in order to use the clipboard (as well as any application you copy a PICT from); use “activate” in a script.
  42.  
  43. clip2gif is recordable (i.e. you can record the conversions with all their options in an AppleScript if you push the record button of the ScriptEditor).
  44.  
  45. Typical use
  46.  
  47. tell application "clip2gif"
  48.     convert file "test.pict" saving as GIF scale 50 depth 4 with interlacing without transparency
  49.                 --creates a file named test.gif
  50. end tell
  51.  
  52. Drawings
  53.  
  54. It's possible to script clip2gif to draw simple graphical elements, such as text, lines, frames and filled rectangles. For this, use the drawing argument. Scale has no effect. You can start either with an existing picture (specify a PICT file the usual way), or with a blank rectangle (specify its size as a list of two numbers). The argument of drawing is a list of records containing:
  55.  
  56. drawn text:"string" -- the text to draw
  57. rectangle:{left,top,right,bottom} -- filled rectangle
  58. frame:{left,top,right,bottom} --  outline of rectangle
  59. line:{x1,y1,x2,y2} -- straight line
  60. RGB color:{r,g,b} -- red, green and blue in %
  61. position:{x,y} -- position of the text
  62. font:"font name" -- font name
  63. size:fontSize -- characters size (in points)
  64.  
  65. Examples
  66.  
  67. --converts a PICT file to GIF and adds a title
  68. convert file "test.pict" saving as GIF with interlacing drawing
  69.         {{drawn text:"This is a test", position:{50,20}, RGB color:{100,0,0},font:"Times",size:24}}
  70.  
  71. --creates a GIF file from scratch with a line, a frame and a filled rectangle
  72. convert {240,160} saving as GIF in file "test.gif"
  73.         drawing {{line:{10,10,100,10},thickness:2},
  74.                 {frame:{10,20,100,80}},
  75.                 {rectangle:{15,25,105,85},RGB color:{100,100,0}}}
  76.  
  77. Requirements
  78.  
  79. clip2gif needs System 7 or above and 32-bit Color Quickdraw. QuickTime is needed for JPEG conversion. AppleScript is obviously needed to (Apple-)script clip2gif. The entire scaled image must fit in RAM; set the application memory partition appropriately.
  80.  
  81. Copyright
  82.  
  83. clip2gif Copyright 1995 by Yves Piguet.
  84.  
  85. clip2gif is freeware; this means that you can freely use it, copy it and give it to your friends as long as:
  86.  
  87. -clip2gif and this readme file are kept together;
  88. -clip2gif is not modified (especially the copyright notice) or reverse-engineered;
  89. -you don't charge for it.
  90.  
  91. clip2gif 0.4 for HTML+ is strictly the same as clip2gif 0.4; only the version shown in the Get Info window is different. clip2gif 0.4 can be found on the info-mac server and its mirrors in grf/util as "clip-to-gif-04.sit.hqx".
  92.  
  93. clip2gif cannot be included in another package without my prior written permission.
  94.  
  95. Source code is not available.
  96.  
  97. Please send me a note (postcards or email or banknotes) if you use it!
  98.  
  99. Changes
  100.  
  101. 0.4
  102.  
  103. • Graphic elements
  104. • Creation from an empty rectangle
  105. • Gray shades GIF output
  106. • Edit menu (useful only with the "Save as" dialog)
  107. • More system environment tests
  108. • Balloon help
  109.  
  110. 0.3.0.1
  111.  
  112. • AppleShare volume writing corrected
  113.  
  114. 0.3
  115.  
  116. • “convert "..." saving as...” AE to allow different output file formats
  117. • JPEG output (if QuickTime is present)
  118. • PICT output (useful only for the clipboard)
  119. • recordable
  120. • preferences file
  121. • icons
  122. • displays the about box when an oapp Apple Event is received
  123. • the depth parameter code is now 'pdpt', as specified in the AppleEvent Registry
  124.  
  125. 0.2
  126.  
  127. • fat binary
  128. • possibility to scale the output between 1 & 1000 % (open the "Get Info" of clip2gif and specify more memory if necessary; 1000% of a 640x480 screen means 30 Mb!)
  129. • watch cursor during conversion
  130. • "Save Clipboard As Gif..." dimmed if the clipboard doesn't contain a pict
  131.  
  132. Warranty
  133.  
  134. There is absolutely NO warranty. clip2gif seems to work as expected, at least on my computer, but I'm not liable for any loss of data, damages, etc. or any consequential effect. It has produced files a few programs seem to be able to decode, but it is in no way "certified" to encode fully compliant GIF files.
  135.  
  136. Acknowledgement
  137.  
  138. The Graphics Interchange Format(c) is the Copyright property of CompuServe Incorporated. GIF(sm) is a Service Mark property of CompuServe Incorporated.
  139.  
  140. Disclaimer
  141.  
  142. The above statement doesn't mean anything more than what is specified in the GRAPHICS INTERCHANGE FORMAT v.89a specifications.
  143.  
  144. Author
  145.  
  146. Yves Piguet <piguet@ia.epfl.ch>
  147. Institut d'automatique
  148. EPFL
  149. 1015 Lausanne
  150. Switzerland
  151.  
  152. Web: http://iawww.epfl.ch/Staff/Yves.Piguet/Yves.Piguet.html
  153.